package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TGongzMapper;
import com.ruoyi.system.domain.TGongz;
import com.ruoyi.system.service.ITGongzService;
import com.ruoyi.common.support.Convert;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;


/**
 * 工装 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-26
 */
@Service
public class TGongzServiceImpl implements ITGongzService 
{
	@Autowired
	private TGongzMapper tGongzMapper;

	/**
     * 查询工装信息
     * 
     * @param gzId 工装ID
     * @return 工装信息
     */
    @Override
	public TGongz selectTGongzById(String gzId)
	{
	    return tGongzMapper.selectTGongzById(gzId);
	}
	
	/**
     * 查询工装列表
     * 
     * @param tGongz 工装信息
     * @return 工装集合
     */
	@Override
	public List<TGongz> selectTGongzList(TGongz tGongz)
	{
	    return tGongzMapper.selectTGongzList(tGongz);
	}
	
    /**
     * 新增工装
     * 
     * @param tGongz 工装信息
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int insertTGongz(TGongz tGongz)
	{
	    return tGongzMapper.insertTGongz(tGongz);
	}
	
	/**
     * 修改工装
     * 
     * @param tGongz 工装信息
     * @return 结果
     */
	@Override
	public int updateTGongz(TGongz tGongz)
	{
	    return tGongzMapper.updateTGongz(tGongz);
	}

	/**
     * 删除工装对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int deleteTGongzByIds(String ids)
	{
		return tGongzMapper.deleteTGongzByIds(Convert.toStrArray(ids));
	}
	
}
